﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

using LINQToolKit;
using LINQToolKit.Douban.Entities;
using LINQToolKit.Mapping;
using LINQToolKit.Processors;

namespace LINQToolKit.Douban.Processors
{
    public sealed class CategoryProcessor : PropertyProcessor
    {
        public override object FromXml(MetaProperty meta, IEnumerable<XElement> elements)
        {
            var e = elements.First();

            return new AtomCategory
            {
                Scheme = e.Attribute("scheme").GetString(),
                Term = e.Attribute("term").GetString()
            };
        }
    }
}
